from django.conf.urls import url
from django.contrib import admin
from rest_framework.routers import DefaultRouter
from rest_framework_jwt.views import obtain_jwt_token

from .views import statistical
from .views import users,specs

urlpatterns = [
    # JWT 登录
    url(r'^authorizations/$', obtain_jwt_token),
    #------------数据统计----------------
    # 注册用户总数
    url(r'^statistical/total_count/$', statistical.UserTotalCountView.as_view()),
    # 当日新增用户总数
    url(r'^statistical/day_increment/$', statistical.UserDayCountView.as_view()),
    # 当日日活用户总数
    url(r'^statistical/day_active/$', statistical.UserDayCountActiveView.as_view()),
    # 当日下单用户总数
    url(r'^statistical/day_orders/$', statistical.UserOrderCountView.as_view()),
    # 一个月内每天注册用的数量
    url(r'^statistical/month_increment/$', statistical.UserMonthCountView.as_view()),
    # 日分类商品访问量
    url(r'^statistical/goods_day_views/$', statistical.GoodsTypeVisitView.as_view()),
    #--------------用户数据操作-----------------
    url(r'^users/$', users.UserView.as_view()),
    # ------- 规格表路由匹配-----------
    # 获取spu商品
    url(r'^goods/simple/$',specs.SpecsView.as_view({'get':'simple'})),


]
# ------- 规格表路由匹配-----------
# goods/specs/simple
router = DefaultRouter()
router.register('goods/specs',specs.SpecsView,base_name='spec')
urlpatterns += router.urls